﻿using MrPP.iot;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

namespace MrPP.SerriedCabinet
{

    [System.Serializable]
    public class Setup : NetworkBehaviour
    {
       
        [System.Serializable]
        public struct Data
        {
            public string area;
            public string room;
            public int temperature;
            public int humidity;
            public BoxManager.Data cabinets;

           
        }
        public bool _init = false;

        

        public Action onSetup {
            get;
            set;
        }

        [SyncVar(hook = "dataChanged")]
        public Data data;
        public void dataChanged(Data val) {
            data = val;
            _init = true;
            onSetup?.Invoke();

        }   
 
    }
}

